From d05727902ff268894db2ac8950aefc1f0f470049 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 29 Mar 2007 16:18:39 +0100 Subject: [PATCH] Fix bad behaviour of xm when calling event.next(), by adding a different error code (SESSION_NOT_REGISTERED). Signed-off-by: Ewan Mellor --- docs/xen-api/xenapi-datamodel.tex | 17 +++++++++++++++-- tools/python/xen/xend/XendAPI.py | 2 +- tools/python/xen/xm/messages/en/xen-xm.po | 5 ++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/xen-api/xenapi-datamodel.tex b/docs/xen-api/xenapi-datamodel.tex index 480761eff5..04fc5bccca 100644 --- a/docs/xen-api/xenapi-datamodel.tex +++ b/docs/xen-api/xenapi-datamodel.tex @@ -1131,8 +1131,10 @@ Blocking call which returns a (possibly empty) batch of events. the batch of events \vspace{0.3cm} -\vspace{0.3cm} -\vspace{0.3cm} + +\noindent{\bf Possible Error Codes:} {\tt SESSION\_NOT\_REGISTERED} + +\vspace{0.6cm} \vspace{1cm} \newpage @@ -13836,6 +13838,17 @@ current connection. The handle parameter echoes the bad value given. \begin{verbatim}SESSION_INVALID(handle)\end{verbatim} \begin{center}\rule{10em}{0.1pt}\end{center} +\subsubsection{SESSION\_NOT\_REGISTERED} + +This session is not registered to receive events. You must call +event.register before event.next. The session handle you are using is +echoed. + +\vspace{0.3cm} +{\bf Signature:} +\begin{verbatim}SESSION_NOT_REGISTERED(handle)\end{verbatim} +\begin{center}\rule{10em}{0.1pt}\end{center} + \subsubsection{VALUE\_NOT\_SUPPORTED} You attempted to set a value that is not supported by this implementation. diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index af175183b6..856a53f10a 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -122,7 +122,7 @@ def event_unregister(session, unreg_classes): def event_next(session): if session not in event_registrations: - return xen_api_error(['SESSION_INVALID', session]) + return xen_api_error(['SESSION_NOT_REGISTERED', session]) queue = event_registrations[session]['queue'] events = [queue.get()] try: diff --git a/tools/python/xen/xm/messages/en/xen-xm.po b/tools/python/xen/xm/messages/en/xen-xm.po index 6e289b4aa3..fed538a663 100644 --- a/tools/python/xen/xm/messages/en/xen-xm.po +++ b/tools/python/xen/xm/messages/en/xen-xm.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: Xen-xm 3.0\n" -"PO-Revision-Date: 2007-03-10 23:17+0000\n" +"PO-Revision-Date: 2007-03-29 16:13+0100\n" "Last-Translator: Ewan Mellor \n" "Language-Team: xen-devel \n" "MIME-Version: 1.0\n" @@ -64,3 +64,6 @@ msgstr "The VM must be %(2)s to perform the requested operation (it is currently msgid "VM_HVM_REQUIRED" msgstr "HVM guest support is unavailable: is VT/AMD-V supported by your CPU and enabled in your BIOS?" + +msgid "SESSION_NOT_REGISTERED" +msgstr "This session is not registered to receive events. You must call event.register before event.next. (Session handle is %(1)s.)" -- 2.30.2